Deep packet inspection (DPI) is an advanced method of packet filtering that functions at the upper layers of the OSI (Open Systems Interconnection) reference model. The upper layers (e.g., layers 4-7 of the OSI model) provide services for an application program to ensure that effective communication with another application program in a network is possible. The application layer is not the application itself that is doing the communication. It is a service layer that ensures that the other party is identified and can be reached, authenticates either the message sender or receiver or both, ensures that necessary communication resources/hardware exist, determines error recovery procedures, data integrity, privacy, protocol, and data syntax rules at the different network protocol levels.